<template>
    <div class="tabbar">
        <div class="tabbar_item"
        v-for="(item,index) in tabbarList" :key="index"
        :class="index == tabbarFlag ? 'tabarLight' : ''"
        @click="changeMenu(index)"
        >
            {{item}}
        </div>
    </div>
</template>

<script>
export default {
    name: 'tabbar',
    props: [
        'tabbarList',
    ],
    data() {
        return {
            tabbarFlag:0,
        };
    },
    computed: {

    },
    created() {

    },
    mounted() {

    },
    watch: {

    },
    methods: {
        changeMenu(index){
            this.tabbarFlag = index
            this.$emit('getCurrentIndex',index)
        }
    },
    components: {

    },
};
</script>

<style scoped lang="less">
@itemecolor:#E03F40;
.position_flex(@jc:space-between,@ai:center){
  display: flex;
  align-items: @ai;
  justify-content: @jc;
}
.tabbar{
    .position_flex(flex-start);
    border-bottom: 1px solid;
    
    margin-top: 40px;
    .tabbar_item{
        margin-left: 50px;
        padding: 20px 0;
        cursor: pointer;
        box-sizing: border-box;
        border-bottom: 5px solid transparent;
    }
    .tabarLight{
        border-bottom: 5px solid @itemecolor;
    }
}
</style>
